﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.redshift
{
	// Token: 0x02000108 RID: 264
	public class TRedshiftComment : TCustomSqlStatement
	{
		// Token: 0x17000182 RID: 386
		// (get) Token: 0x060008A8 RID: 2216 RVA: 0x003024FD File Offset: 0x003006FD
		// (set) Token: 0x060008A9 RID: 2217 RVA: 0x00302505 File Offset: 0x00300705
		public virtual EDbObjectType DbObjectType
		{
			get
			{
				return this.dbObjectType;
			}
			set
			{
				this.dbObjectType = value;
			}
		}

		// Token: 0x17000183 RID: 387
		// (get) Token: 0x060008AA RID: 2218 RVA: 0x0030250E File Offset: 0x0030070E
		// (set) Token: 0x060008AB RID: 2219 RVA: 0x00302516 File Offset: 0x00300716
		public virtual TObjectName ObjectName
		{
			get
			{
				return this.objectName;
			}
			set
			{
				this.objectName = value;
			}
		}

		// Token: 0x17000184 RID: 388
		// (get) Token: 0x060008AC RID: 2220 RVA: 0x0030251F File Offset: 0x0030071F
		// (set) Token: 0x060008AD RID: 2221 RVA: 0x00302527 File Offset: 0x00300727
		public virtual TObjectName OnObjectName
		{
			get
			{
				return this.onObjectName;
			}
			set
			{
				this.onObjectName = value;
			}
		}

		// Token: 0x17000185 RID: 389
		// (get) Token: 0x060008AE RID: 2222 RVA: 0x00302530 File Offset: 0x00300730
		// (set) Token: 0x060008AF RID: 2223 RVA: 0x00302538 File Offset: 0x00300738
		public virtual string CommentText
		{
			get
			{
				return this.commentText;
			}
			set
			{
				this.commentText = value;
			}
		}

		// Token: 0x060008B0 RID: 2224 RVA: 0x00302541 File Offset: 0x00300741
		public TRedshiftComment(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstredshiftComment;
		}

		// Token: 0x060008B1 RID: 2225 RVA: 0x00302558 File Offset: 0x00300758
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TDummy tdummy = (TDummy)this.rootNode;
			this.objectName = (TObjectName)tdummy.node1;
			this.commentText = tdummy.st1.ToString();
			switch (tdummy.int1)
			{
			case 1:
				this.dbObjectType = EDbObjectType.column;
				break;
			case 2:
				this.dbObjectType = EDbObjectType.table;
				break;
			case 3:
				this.dbObjectType = EDbObjectType.view;
				break;
			case 4:
				this.dbObjectType = EDbObjectType.database;
				break;
			case 5:
				this.dbObjectType = EDbObjectType.constraint;
				this.onObjectName = (TObjectName)tdummy.node2;
				break;
			}
			return 0;
		}

		// Token: 0x060008B2 RID: 2226 RVA: 0x00302609 File Offset: 0x00300809
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060008B3 RID: 2227 RVA: 0x00302619 File Offset: 0x00300819
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x04001222 RID: 4642
		private EDbObjectType dbObjectType;

		// Token: 0x04001223 RID: 4643
		private TObjectName objectName;

		// Token: 0x04001224 RID: 4644
		private TObjectName onObjectName;

		// Token: 0x04001225 RID: 4645
		private string commentText;
	}
}
